from funasr import AutoModel

class Worker(object):
    def __init__(self):
        print("coze.worker.__init__")
        self.model = AutoModel(model="ct-punc", model_revision="v2.0.4")

    def proc(self, input):
        res = self.model.generate(input=input)
        # print(res)
        return res[0].get("text")

if __name__ == "__main__":
    worker = Worker()
    for i in range(10):
        res = worker.proc("那今天的会就到这里吧 happy new year 明年见")
        print(res)
        res = worker.proc("那今天的会就到这里吧 happy new year 明年见")
        print(res)
